package com.sgb.kjwl.view.widget.map;

import android.content.Context;
import androidx.databinding.DataBindingUtil;
import androidx.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;

import com.sgb.kjwl.R;
import com.sgb.kjwl.databinding.MapGasWindowBinding;

import com.sgb.kjwl.model.entity.GasListInfoEntity;


/**
 * Description:
 * Author Wangbinchen
 *
 */
public class GasMapWindow extends LinearLayout {

    protected Context mContext;
    protected MapGasWindowBinding viewBinding;
    private GasListInfoEntity gasListInfoEntity;

    public GasMapWindow(Context context) {
        this(context, null);
    }

    public GasMapWindow(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public GasMapWindow(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        this(context, attrs, defStyleAttr, 0);
    }

    public GasMapWindow(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr);
        this.mContext = context;
        initView();
    }

    private void initView() {
        viewBinding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.map_gas_window, this, true);
    }



    public void setGasData(GasListInfoEntity infoEntity) {
        this.gasListInfoEntity = infoEntity;
        viewBinding.tvPrice.setText("¥"+infoEntity.getPrice());
        viewBinding.tvName.setText(infoEntity.getGasStationName());
    }



    public GasListInfoEntity getData() {
        return gasListInfoEntity;
    }
}
